package com.hmall.item.config;

import com.hmall.item.web.interceptor.GetHeaderHandlerInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * mvc配置类
 *
 * @Author XiaoJiangShi
 * @Date 2022/8/12 14:51
 * @Blog blog.XiaoJiangShi.net/996.mba
 * @Description: mvc配置类
 */
@Slf4j
@Configuration
public class MvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new GetHeaderHandlerInterceptor())
                .addPathPatterns("/**");
    }
}

